package com.ocean.controller.news;

import com.ocean.entity.news.Context;
import com.ocean.service.news.ContextService;
import com.ocean.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/context")
public class ContextController {
    @Autowired
    private ContextService service;

    @PostMapping("save.do")
    public R save(@RequestBody Context context){
        return service.save(context);
    }
    @PostMapping("update.do")
    public R update(@RequestBody Context context){
        return service.update(context);
    }
    @GetMapping("del.do")
    public R delete(int id){
        return service.delete(id);
    }
    @GetMapping("page.do")
    public R page(int page, int size){
        return service.queryPage(page, size);
    }

}
